package com.se.data;

import java.util.Date;

/**
 * Simple object that encapsulates a captured request.  The request key contains the ID and an
 * optional tag.
 * 
 * @author seldred
 */
public class CapturedRequest {

	private static final long ID_NOT_SET = 0;
	
	private RequestKey key;
	
	private String title;
	
	private String content;
	
	private Date timestamp;

	public CapturedRequest(String tag, String title, String content) {
		this(ID_NOT_SET, tag, title, content, new Date());
	}
	
	public CapturedRequest(long id, String tag, String title, String content, Date timestamp) {
		key = new RequestKey(id, tag);
		this.title = title;
		this.content = content;
		this.timestamp = timestamp;
	}

	public RequestKey getKey() {
		return key;
	}

	public void setKey(RequestKey key) {
		this.key = key;
	}

	public long getId() {
		return key.getId();
	}

	public void setId(long id) {
		key.setId(id);
	}

	public String getTag() {
		return key.getTag();
	}

	public void setTag(String tag) {
		key.setTag(tag);
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}
}
